package com.suncnpap.journal.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.app.util.database.mybatis.Page;
import com.suncnpap.journal.service.BorrowJournalService;
import com.suncnpap.journal.mapper.BorrowJournalMapper;
import com.suncnpap.journal.model.BorrowJournal;
import com.suncnpap.journal.model.BorrowJournalInfo;

/** 
 * 说明： 期刊借阅Service实现类
 * @version
 */
@Service("borrowJournalService")
public class BorrowJournalServiceImpl implements BorrowJournalService{

	
	@Autowired
	BorrowJournalMapper borrowJournalMapper;
	
	@Override
	public void add(BorrowJournal obj) {
		// TODO Auto-generated method stub
		borrowJournalMapper.add(obj);
	}

	@Override
	public void update(BorrowJournal obj) {
		// TODO Auto-generated method stub
		borrowJournalMapper.edit(obj);
	}

	@Override
	public void deleteById(String strId) {
		// TODO Auto-generated method stub
		borrowJournalMapper.deleteById(strId);
		
	}
	@Override
	public void deleteMore(String[] strIds) {
		// TODO Auto-generated method stub
		borrowJournalMapper.deleteMore(strIds);
	}

	@Override
	public Page list(Page page) {
		// TODO Auto-generated method stub
		List<BorrowJournal> list = borrowJournalMapper.datalistPage(page);
		page.setDataList(list);
		return page;
	}


	@Override
	public int findCount(Page page) {
		// TODO Auto-generated method stub
		return borrowJournalMapper.findCount(page);
	}

	@Override
	public BorrowJournal findById(String strId) {
		// TODO Auto-generated method stub
		return borrowJournalMapper.findById(strId);
	}
	
	@Override
	public void deleteByJournalBarcode(String strJournalBarcode, String strSchoolId){
		borrowJournalMapper.deleteByJournalBarcode(strJournalBarcode, strSchoolId);
	}
	
	@Override
	public int findCountByCardNumber(String strCardNumber, String strSchoolId){
		return borrowJournalMapper.findCountByCardNumber(strCardNumber, strSchoolId);
	}
	
	@Override
	public Page listInfo(Page page) {
		// TODO Auto-generated method stub
		List<BorrowJournalInfo> list = borrowJournalMapper.dataInfolistPage(page);
		page.setDataList(list);
		return page;
	}
	
	@Override
	public BorrowJournal findByJournalBarcode(String strJournalBarcode, String strSchoolId){
		return borrowJournalMapper.findByJournalBarcode(strJournalBarcode, strSchoolId);
	}
}

